package patterndesign.factory;

/**
 * @Description
 * @Date 2021/9/18
 * @Created by Jonathan
 */
public class NvWa {
    public static void main(String[] args) {
        AbstractHumanFactory yinYangLu = new HumanFactory();
        System.out.println("--------制造第一批白色人种----------");
        WhiteHuman whiteHuman = yinYangLu.createHuman(WhiteHuman.class);
        whiteHuman.getColor();
        whiteHuman.talk();
        System.out.println("--------制造第一批黄色人种----------");
        YellowHuman yellowHuman = yinYangLu.createHuman(YellowHuman.class);
        yellowHuman.getColor();
        yellowHuman.talk();
        System.out.println("--------制造第一批黑色人种----------");
        BlackHuman blackHuman = yinYangLu.createHuman(BlackHuman.class);
        blackHuman.getColor();
        blackHuman.talk();
    }
}
